﻿<UserControl xmlns:PageBar="clr-namespace:Mengsk.ProxyDelivery.App.UI.PageBar"  x:Class="Mengsk.ProxyDelivery.App.UI.Order.OrderExamineUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="1200" Loaded="UserControl_Loaded">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Orientation="Horizontal">
            <TextBlock Text="检查标记:" Margin="3" VerticalAlignment="Center"/>
            <ComboBox VerticalAlignment="Center" Margin="3" Name="cbbCheckState" Width="80">
                <ComboBoxItem>所有</ComboBoxItem>
                <ComboBoxItem>未检查</ComboBoxItem>
                <ComboBoxItem>已检查</ComboBoxItem>
                <ComboBox.SelectedIndex>1</ComboBox.SelectedIndex>
            </ComboBox>
            <TextBlock Text="下单时间:" Margin="3" VerticalAlignment="Center"/>
            <DatePicker Name="dpStart" Margin="3" VerticalAlignment="Center" Width="130"/>
            <TextBlock Text="到:" Margin="3" VerticalAlignment="Center"/>
            <DatePicker Name="dpEnd" Margin="3" VerticalAlignment="Center" Width="130"/>
            <TextBlock Text="检查人员:" Margin="3" VerticalAlignment="Center"/>
            <TextBox Name="tbCheckComment" Margin="3" VerticalAlignment="Center" Width="80"/>
            <Button Grid.Row="0" Content="查询" Name="btnDownload" Click="btnDownload_Click" Width="60" FontSize="12" HorizontalAlignment="Left" VerticalAlignment="Center"/>
            
        </StackPanel>
        <DataGrid Grid.Row="1" Name="dgItems" GridLinesVisibility="All" AutoGenerateColumns="False" SelectionMode="Extended" SelectionUnit="FullRow" RowHeaderWidth="25">
            <DataGrid.Columns>
                <DataGridTextColumn Header="订单编号" Width="Auto" Binding="{Binding Source.OrderId}" IsReadOnly="True"/>
                <DataGridTextColumn Header="商品编号" Width="Auto" Binding="{Binding Source.Id}" IsReadOnly="True"/>
                <DataGridTextColumn Header="厂家" Width="Auto" Binding="{Binding Source.Vendor}" IsReadOnly="True"/>
                <DataGridTextColumn Header="货号" Width="Auto" Binding="{Binding Source.Number}" IsReadOnly="True"/>
                <DataGridTextColumn Header="版本" Width="Auto" Binding="{Binding Source.Edtion}" IsReadOnly="True"/>
                <DataGridTextColumn Header="颜色" Width="Auto" Binding="{Binding Source.Color}" IsReadOnly="True"/>
                <DataGridTextColumn Header="尺码" Width="Auto" Binding="{Binding Source.Size}" IsReadOnly="True"/>
                <DataGridTextColumn Header="状态" Width="Auto" Binding="{Binding Source.State,Converter={StaticResource descriptionConverter}}"/>
                <DataGridTextColumn Header="数量" Width="Auto" Binding="{Binding Source.Count}" IsReadOnly="True"/>
                <DataGridTextColumn Header="单价" Width="Auto" Binding="{Binding Source.Price}"  IsReadOnly="True"/>
                <DataGridTextColumn Header="实际单价" Width="Auto" Binding="{Binding Price}" />
                <DataGridHyperlinkColumn Header="更新" Width="Auto" Binding="{Binding Path=Action}"  IsReadOnly="True">
                    <DataGridHyperlinkColumn.ElementStyle>
                        <Style>
                            <EventSetter Event="Hyperlink.Click" Handler="Update_Clicked"/>
                        </Style>
                    </DataGridHyperlinkColumn.ElementStyle>
                </DataGridHyperlinkColumn>
                <DataGridTextColumn Header="检查时间" Width="Auto" Binding="{Binding CheckTime,Converter={StaticResource datetimeConverter}}"   IsReadOnly="True"/>
                <DataGridTextColumn Header="检查描述" Width="Auto" Binding="{Binding CheckComment}"   IsReadOnly="True"/>
                <DataGridHyperlinkColumn Header="商品网址" Binding="{Binding Url}"   IsReadOnly="True">
                    <DataGridHyperlinkColumn.ElementStyle>
                        <Style>
                            <EventSetter Event="Hyperlink.Click" Handler="Open_Click"/>
                        </Style>
                    </DataGridHyperlinkColumn.ElementStyle>
                </DataGridHyperlinkColumn>
            </DataGrid.Columns>
        </DataGrid>
        <PageBar:PageBarUserControl Grid.Row="2" x:Name="pbBar" PageSize="500" PageChanging="pbBar_PageChanging"/>
    </Grid>
</UserControl>
